-
Notifications
You must be signed in to change notification settings - Fork 263
demo_diff_drive_controller #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo_diff_drive_controller #70
Conversation
destogl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for our contribution it looks very good. I have mostly nitpicks and a few clarification comments.
ros2_control_demo_hardware/include/ros2_control_demo_hardware/diffbot_system.hpp
Outdated
Show resolved
Hide resolved
ros2_control_demo_hardware/include/ros2_control_demo_hardware/diffbot_system.hpp
Show resolved
Hide resolved
ros2_control_demo_hardware/include/ros2_control_demo_hardware/diffbot_system.hpp
Outdated
Show resolved
Hide resolved
ros2_control_demo_hardware/include/ros2_control_demo_hardware/diffbot_system.hpp
Show resolved
Hide resolved
ros2_control_demo_robot/description/diffbot/diffbot_system.ros2_control.xacro
Outdated
Show resolved
Hide resolved
ros2_control_demo_robot/description/diffbot/diffbot_system.ros2_control.xacro
Outdated
Show resolved
Hide resolved
destogl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One step further.
| #include "hardware_interface/types/hardware_interface_status_values.hpp" | ||
| #include "ros2_control_demo_hardware/visibility_control.h" | ||
|
|
||
| using hardware_interface::return_type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove this using and then adjust everywhere return_type? It's fairly simple with repalce-all function.
ros2_control_demo_hardware/include/ros2_control_demo_hardware/diffbot_system.hpp
Show resolved
Hide resolved
|
|
||
| for (uint i = 0; i < hw_commands_.size(); i++) { | ||
| // Simulate DiffBot's movement | ||
| hw_states_[1] = hw_commands_[i] + (hw_states_[1] - hw_commands_[i]) / hw_slowdown_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this slowdown make sense when using diff drive robot? I understand that your commands are velocities? you should here probably integrate to get position state and mabye create some artificial dynamics when velocity is changed. Does this make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I didn't understand the meaning of slowdown parameter. I was assuming it was a 'time constant' for rrbot dynamics.
Yes, my commands are velocities. I've changed my dynamics equation to get the velocity state.
I am aware that is necessary to integrate to get position state but as long as I understood, since the read function is reading from the hardware, the hardware would provide those infos (including the position state already integrated).
So, I integrated hw_states_[0] += hw_states_[1] / 2; with 'update_rate = 2' just to exhibit the data in radians. Otherwise, Should I calculate the current and last time inside diffbot_system? What do you recommend?
|
Linters is putting a linelength=140 which is getting unrecognized. |
bmagyar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good in general, a few comments that could reduce the overall content of this PR
ros2_control_demo_robot/description/diffbot/diffbot.gazebo.xacro
Outdated
Show resolved
Hide resolved
ros2_control_demo_robot/description/diffbot/diffbot.gazebo.xacro
Outdated
Show resolved
Hide resolved
bmagyar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
|
Friendly ping @destogl |
883c7c3 to
c5badc8
Compare
destogl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to keep this open anymore. @BorgesJVT thank you for your patience. I will open a follow-up issue for the documenation. I will try to integrate this into #76.
|
This PR is not working correctly I believe. The controller config is not being installed, which leads to an incorrect loading of parameters and the ros2_control node eventually failing due to a non-existing |
Resolves #50